//---------------------------------------------------------------------
// <copyright file="CsdlSemanticsFunction.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using Microsoft.Data.Edm.Csdl.Internal.Parsing.Ast;

namespace Microsoft.Data.Edm.Csdl.Internal.CsdlSemantics
{
    /// <summary>
    /// Provides semantics for a CsdlFunction.
    /// </summary>
    internal class CsdlSemanticsFunction : CsdlSemanticsFunctionBase, IEdmFunction
    {
        private readonly CsdlFunction function;

        public CsdlSemanticsFunction(CsdlSemanticsSchema context, CsdlFunction function)
            : base(context, function)
        {
            this.function = function;
        }

        public override CsdlSemanticsModel Model
        {
            get { return this.Context.Model; }
        }

        public override CsdlElement Element
        {
            get { return this.function; }
        }

        public string Namespace
        {
            get { return this.Context.Namespace; }
        }

        public string DefiningExpression
        {
            get { return this.function.DefiningExpression; }
        }

        public EdmSchemaElementKind SchemaElementKind
        {
            get { return EdmSchemaElementKind.Function; }
        }
    }
}
